#!/usr/bin/env python
#
# common.py  - defs for control.py
# 
# User: bob
# Date: 11/05/14
# Copyright (C) 2014 by G3UKB Bob Cowdery
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#    
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#    
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#    
#  The author can be reached by email at:   
#     bob@bobcowdery.plus.com
#

from common.defs import *

# Modes
AUTO = 'auto'
PROMPT = 'prompt'
MANUAL = 'manual'
OFF = 'off'

# Run state
INITIAL = 0
RUNNING = 1
STOPPED = 2

# Default config
DEFAULT_STATE = {
    WINDOW_X: 400,
    WINDOW_Y: 400,
    WINDOW_WIDTH: -1,
    WINDOW_HEIGHT: -1,
}

DEFAULT_CONFIG = {
    COMMON: {
        IN_RATE: 48000,
        OUT_RATE: 48000,
        NUM_RX: 1,
        IQ_BLK_SZ: 1024,
        MIC_BLK_SZ: 1024,
        DUPLEX: False,
        TX: False,
        POWER: {
            PWR_MODE: AUTO,
            PWR_IP: '192.168.1.100',
            PWR_USER: 'admin',
            PWR_PW: '12345678',
            PWR_OUTLET: 1,
        },
        AUDIO: {
            IN_SRC: HPSDR,
            IN_HOSTAPI: '',
            IN_DEV: '',
            OUT_SINK: HPSDR,
            ROUTING: {
                HPSDR:[[1, '', '', BOTH],],
                LOCAL: []   
            }
        },
        ANTENNA: {
            ANT_SETTING: {ANT_1: [MIN_FREQ, MAX_FREQ],},
            ANT_PREC: 'default'
        }
    },
    RX: {
        DISPLAYS: {
            PAN_MODE: 3,
            PAN_FRM_AV: 30,
            WINDOW_TYPE: 5,
            PAN_FFT_SZ: 4096
        }
    },
    TX: {
        LEVELS: {
            TUNE_DRIVE_LEVEL: 20
        }
    } 
}



